package com.saleoffline.server;

public class PageNavigator extends BaseObject {
	public static int LIST_SIZE = 20;
	private int page = 1;
	private int listSize;

	public int getListSize() {
		if (listSize < 1) {
			return LIST_SIZE;
		}
		return listSize;
	}

	public void setListSize(int listSize) {
		this.listSize = listSize;
	}

	public int getPage() {
		if (page < 1) {
			return 1;
		}
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getOffset() {
		return (getPage() - 1) * getListSize();
	}
}
